version: '3.1'

services:
  springapp:
    build: ./web
    container_name: springapp

    ports:
      - 8000:8080
    restart: always

lib_db:
    image: postgres
    container_name: lib_db
    environment:
        POSTGRES_PASSWORD: 123456
        POSTGRES_USER: john
        POSTGRES_DB: book_db
        PGDATA: /var/lib/postgresql/data
    ports:
      - 5000:5432
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always
volumes:
  pgdata:
